<script type="text/javascript" charset="utf-8" >

$(function(){
	
	var url_contact_us =  "<?=site_url(); ?>index.php";
	
	// Add blackbox
	$('.videos > .videos_item > a').each(function(index){
		
		// Each item add blackbox
		$(this).fancybox();
		
	});
	
	// Add even to paging link 's video div 
	$('.videos .paging >a').each(function(index){
		
		$(this).click(function(event){
			
			event.preventDefault();
			
			// Get href attribute 's anchor
			var local_url = $(this).attr('href');
						
			console.log(url_contact_us+'/'+local_url);			
	
			$(this).parents('.videos').load(url_contact_us+'/'+local_url, function(){
				// Load videos div successfully !
			});
		
		});
		
	});
	
});

</script>
<?php if (!empty($videos) && isset($videos)) : ?>

<?php foreach ($videos as $item) :?>
	
	<div class="videos_item">
		<a href="<?=site_url().'index.php/home/video_detail/'.$type.'/'.$item->id;?>">
			<img src="<?=base_url().$this->config->item('fd_product_avatar_video_url').$item->image;?>" width="160" height="125" title="<?=$item->name;?>"/>
		</a>		
	</div>
	
<?php endforeach; ?>

<?php else : ?>

	<?=$this->lang->line('lmg_videos_empty');?>

<?php endif ; ?>

<div style="clear:both"></div>

<div class="paging">
	<?=$videos_link?>
</div>
